home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1996 June / MACPOWER-1996-06.ISO.7z / MACPOWER-1996-06.ISO / Apple関連 / OpenDoc J-1.0 / 3rd Party Components / Attachmate CyberTerm / _SOM_ / som_CyberTermCyberExt.cpp < prev    next >
Text File  |  1995-12-18  |  4KB  |  100 lines

  1.  
  2. /*
  3.  *  This file was generated by the SOM Compiler.
  4.  *  Generated using:
  5.  *     SOM incremental update: 2.33
  6.  */
  7.  
  8. #ifdef DOGSAVVY
  9. #define CyberSample_som_CyberTermCyberExt_Class_Source
  10. #include <som_CyberTermCyberExt.xih>
  11.  
  12.  
  13. #include "CyberTerm.h"        // njp
  14.  
  15. /*
  16.  Overview
  17.  Brokers Cyberdog related messages for its OD part.
  18.  
  19.  Implementation
  20.  
  21.  The methods defined are:
  22.      somInit, GetBasePart, SetBasePart, and most
  23.     interesting....SetCyberItem().
  24.  The extension gets a pointer to the real part early one (stored in
  25.  fBasePart), and carries on a private dialog with it to implement
  26.  Cyberdog behavior.
  27. */
  28.  
  29.  
  30. /*
  31. Store a pointer to the real part in the extension. This should be sent
  32. by the part when it creates the extension. It's just a pointer, the
  33. extension doesn't ref-count it or anything. [・!・ I believe there's some
  34. rational about the real part and the extension always going away at the
  35. same time or something which needs to be verified.] [mention that this
  36. method is part of the private part<->extension dialog, and so could be
  37. called anything-- it's not part of the public API.]
  38. */
  39. SOM_Scope void  SOMLINK som_CyberTermCyberExt__SetBasePart(CyberSample_som_CyberTermCyberExt *somSelf, Environment *ev,
  40.         somToken basePart)
  41. {
  42.     CyberSample_som_CyberTermCyberExtData *somThis = CyberSample_som_CyberTermCyberExtGetData(somSelf);
  43.     CyberSample_som_CyberTermCyberExtMethodDebug("CyberSample_som_CyberTermCyberExt","som_CyberTermCyberExt__SetBasePart");
  44.     
  45.     somThis->fBasePart = basePart;        // njp
  46. }
  47.  
  48.  
  49. /*
  50. Return the extensions current base part pointer. See SetBasePart(). [is
  51. this message ever sent? I kinda don't think so.]
  52. */
  53. SOM_Scope somToken  SOMLINK som_CyberTermCyberExt__GetBasePart(CyberSample_som_CyberTermCyberExt *somSelf, Environment *ev)
  54. {
  55.     CyberSample_som_CyberTermCyberExtData *somThis = CyberSample_som_CyberTermCyberExtGetData(somSelf);
  56.     CyberSample_som_CyberTermCyberExtMethodDebug("CyberSample_som_CyberTermCyberExt","som_CyberTermCyberExt__GetBasePart");
  57.  
  58.     return somThis->fBasePart;            // njp
  59. }
  60.  
  61.  
  62. SOM_Scope void  SOMLINK som_CyberTermCyberExt__somInit(CyberSample_som_CyberTermCyberExt *somSelf)
  63. {
  64.     CyberSample_som_CyberTermCyberExtData *somThis = CyberSample_som_CyberTermCyberExtGetData(somSelf);
  65.     CyberSample_som_CyberTermCyberExtMethodDebug("CyberSample_som_CyberTermCyberExt","som_CyberTermCyberExt__somInit");
  66.  
  67.     CyberSample_som_CyberTermCyberExt_parent_CyberPartExtension_somInit(somSelf);
  68.     somThis->fBasePart = kODNULL;        // njp (not strictly necessary since SOM zeros I think)
  69. }
  70.  
  71.  
  72. /*
  73. This is a simple, low-level message in the CyberPartExtension API. It
  74. simply registers a pointer to the initiating CyberItem during the
  75. CyberItem opening process. It happens to be a convenient cut-point for
  76. a CPE subclass to override so as to receive notification of the
  77. CyberItem opening and so initiate reactions in the real part. In the
  78. puppy example, this message passes through to a message with the same
  79. name and parameters in the real part where the actual handling code is.
  80. */
  81. SOM_Scope void  SOMLINK som_CyberTermCyberExt__SetCyberItem(CyberSample_som_CyberTermCyberExt *somSelf, Environment *ev,
  82.         CyberItem* item,
  83.         ParameterSet* openParams)
  84. {
  85.     CyberSample_som_CyberTermCyberExtData *somThis = CyberSample_som_CyberTermCyberExtGetData(somSelf);
  86.     CyberSample_som_CyberTermCyberExtMethodDebug("CyberSample_som_CyberTermCyberExt","som_CyberTermCyberExt__SetCyberItem");
  87.  
  88.     // DebugStr("¥pExtension::SetCyberItem!!!!!!!!!!!!!");
  89.     
  90.     // The inherited call does maintain a _fCyberItem instance variable for us.
  91.     // We then pass the message through to our real part. njp
  92.     CyberSample_som_CyberTermCyberExt_parent_CyberPartExtension_SetCyberItem(somSelf,ev,item,openParams);
  93.     
  94.     CyberTerm*    realPart = (CyberTerm*) somThis->fBasePart;
  95.     if (realPart) {
  96.         realPart->SetCyberItem(ev, item, openParams);
  97.     }
  98. }
  99. #endif
  100.